import Result from "../utils/Result";

export default function () {
    return async function notFountHandlerMiddleware(ctx, next) {
        try{
            await next();
        }
        catch (err) {
            // 记录到日志
            ctx.logger.error(err);
            ctx.body = Result.setData({
                code: err.status,
                msg: err.message,
                data:null
            })
        }
    };
};